#include "loop_queue.h"
int main(int argc, char const *argv[])
{
    queue_t *my_queue = NULL;
    create_queue(&my_queue);
    printf("my_queue = %p\n",my_queue);

//测试入队列
    push_queue(my_queue,10);
    push_queue(my_queue,20);
    push_queue(my_queue,30);
    push_queue(my_queue,40);
    push_queue(my_queue,50);
    print_queue(my_queue);// 10 20 30 40 50

//测试出队列
    int value = 0;
    int ret = 0;
    ret = pop_queue(my_queue, &value);
    printf("ret = %d  value = %d\n", ret, value); //0 10
    ret = pop_queue(my_queue, &value);
    printf("ret = %d  value = %d\n", ret, value);//0 20
    print_queue(my_queue);

//测试满队列入队列
    push_queue(my_queue,22);
    push_queue(my_queue,23);
    push_queue(my_queue,24);
    push_queue(my_queue,25);
    push_queue(my_queue,26);
    push_queue(my_queue,27);
    push_queue(my_queue,28);//满了，没有28
    print_queue(my_queue);// 30 40 50 22 23 24 25 26 27 
    
//测试清空
    clean_queue(my_queue);
    print_queue(my_queue);
    return 0;
}
